/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package uva12457;

import java.io.*;

import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;

public class Main implements Runnable {

    final String filename = "in";

    public static void main(String[] args) {
        // new Thread(new Main()).start();
        new Thread(null, new Main(), "1", 1 << 25).start();
    }

    public void run() {
        try {
            //in = new BufferedReader(new InputStreamReader(System.in));
            out = new BufferedWriter(new OutputStreamWriter(System.out));
            in = new BufferedReader(new FileReader(filename + ".in"));
            // out = new BufferedWriter(new FileWriter(filename+".out"));
            Fibonacci(80);
            solveF();
            out.flush();
        } catch (Exception e) {
            System.exit(1);
        }
    }

    public void solveF() throws Exception {
        
        while(true){
            int n=iread();
            if(n==0)break;
            out.write( fib[n]+"\n");
        }
    }
    BigInteger[] fib = new BigInteger[81];

    public void Fibonacci(int upto) {
        fib[0] = BigInteger.ZERO;
        fib[1] = BigInteger.ONE;
        fib[2] = BigInteger.valueOf(2);
        for (int i = 3; i <= upto; ++i) {
            fib[i] = fib[i - 1].add( fib[i - 2] ) ;
        }
    }

    public void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public int iread() throws Exception {
        return Integer.parseInt(readword());
    }

    public double dread() throws Exception {
        return Double.parseDouble(readword());
    }

    public long lread() throws Exception {
        return Long.parseLong(readword());
    }
    BufferedReader in;
    BufferedWriter out;

    public String readword() throws IOException {
        StringBuilder b = new StringBuilder();
        int c;
        c = in.read();
        while (c >= 0 && c <= ' ') {
            c = in.read();
        }
        if (c < 0) {
            return "";
        }
        while (c > ' ') {
            b.append((char) c);
            c = in.read();
        }
        return b.toString();
    }
}
